#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int getMaximumConsecutive(vector<int> &coins)
    {
        sort(coins.begin(), coins.end());
        int ret = 1;
        for (auto e : coins)
        {
            if (e > ret)
            {
                break;
            }
            ret += e;
        }
        return ret;
    }
};